package com.zlp.test.controller;


import com.zlp.test.dto.Content;
import com.zlp.test.utils.JsoupUtil;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class JsoupController {

    private final JsoupUtil jsoupUtil;


    @SneakyThrows
    @GetMapping("getParseData")
    public List<Content> getParseData(@RequestParam("keyword") String keyword){

        List<Content> contents = jsoupUtil.parseJD(keyword);
        return contents;
    }

}
